<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">

    <title>Document</title>
</head>
<body>
    <script>
// 求1+2!+3!+...+20!的值
var a=1;
var b=1;
for(var i=1;i<=20;i++){
    b=b*i;
    a=a+b;
 
}   console.log(a);
    </script>
</body>
</html>